<?php session_start();

if(!isset($_SESSION['username'])) header('Location:login.php');

$username = $_SESSION['username'];
$password = $_SESSION['password'];

include( 'mysqli_connect.php' );

$query = "SELECT username, password FROM users WHERE username = '" . $username . "' AND password = '" . $password . "'";

$result = mysqli_query( $dbc , $query );

if(!isset($result)){

   unset($_SESSION['name'], $_SESSION['pass']);
   
   header('Location:login.php');

 //  die( 'U bent niet ingelogd!');
}

?>

